package createType.prototype.example.resume;

import java.util.ArrayList;
import java.util.List;

public class ConcreteResume1 extends PrototypeResume implements Cloneable {
	
	
	private PersonalInformation pi;
	private List<WorkExperience> wlist = new ArrayList<WorkExperience>();
	
	public ConcreteResume1(PersonalInformation pi,List<WorkExperience> wlist) throws CloneNotSupportedException{
		this.pi = pi;
		for(WorkExperience w : wlist)
			this.wlist.add(w.Clone());
	}

	@Override
	public PrototypeResume Clone()  {
		// TODO Auto-generated method stub
		try {
			return (PrototypeResume)super.clone();
		} catch (CloneNotSupportedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	public void print(){
		System.out.println("name:"+pi.getName());
		System.out.println("age:"+pi.getAge());
		System.out.println("gender:"+pi.getGender());
		System.out.println("Experience:");
		for(WorkExperience w:wlist){
			System.out.println(w.getDate()+": "+w.getCompanyName());
		}
	}

}
